A conventional motor control apparatus rotates a rotor of a motor to a target position by switching over a power supply phase of the motor based on an output signal of an encoder. JP 2004-129452A (US 2006/0006827A1, US 2004/0066166A1) discloses a motor control apparatus for rotationally driving a detent plate, which is a driven body of a shift range switchover mechanism of an automatic transmission of a vehicle, by controlling a motor of a shift-by-wire system. This motor control apparatus performs a phase lead control for applying a braking force to a rotor of the motor by correcting a phase lead amount of a power supply phase relative to a rotation phase of the rotor in accordance with a rotation speed of the rotor, when a shift range of the transmission is switched over.
The motor control apparatus performs a wall-hitting control to determine a relative positional relation of the rotor of the motor and the detent plate at such time as, for example, immediately after power-on time. Specifically, the motor control apparatus rotates the rotor until the detent plate hits against one of limit positions of its movable range and learns the rotation position of the rotor as a reference position when the rotor is stopped at the limit position. In performing the wall-hitting control, hitting impact generated when the detent plate hits against the limit position exerts on a rotation transfer part, which is between the motor and the detent plate. In a case that the rotation transfer part is twisted at time of strong hitting of the detent plate against the limit position, the reference position is not learned correctly and hence the rotation position is not controlled with high precision.
It is possible to reduce the hitting impact by decreasing inertia of the rotation transfer part between the rotor and the detent plate, by lowering a motor rotation speed at the wall-hitting control time relative to that of a shift range switchover time. In a case that a phase-lead correction control is performed under a low motor rotation speed condition, the phase lead amount is decreased when the motor rotation speed exceeds a target rotation speed. Thus, relatively large braking force is generated and the motor is likely to be stopped from rotating. As a result, such a stop position is likely to be learned as the reference position although the wall-hitting operation has not been completed. In this case, the rotation position of the detent plate cannot be controlled with high precision.